<template>
  <div class="bg-white my-[10px]">
    <BaseHead style="border-bottom: 0">校内课题</BaseHead>
    <el-table :data="subjectList" class="w-full" border stripe>
      <el-table-column type="index" label="序号" width="60px" />
      <el-table-column prop="projectName" label="课题名称" />
      <el-table-column prop="projectLeader" label="课题负责人"> </el-table-column>
      <el-table-column label="所属单位">
        <template #default="{ row }">
          <CommonTreeLabel
            :value="row.projectUnit"
            valueKey="codeColumn"
            labelKey="valueColumn"
            :dataList="unitList"
          />
        </template>
      </el-table-column>
      <el-table-column prop="projectFee" label="批准经费（万元）" />
    </el-table>
  </div>
</template>

<script setup>
import BaseHead from "@/views/project/components/BaseHead.vue";
import CommonTreeLabel from "@/views/project/components/CommonTreeLabel.vue";
import { schoolSubjectDetail } from "@/api/project/zx/lxxm";
const unitList = inject("unitList");
const subjectList = ref([]);
const operateId = inject("id");
//获取校内课题信息详情
const getSubjectDetail = async () => {
  try {
    const res = await schoolSubjectDetail(operateId.value);
    subjectList.value = res.data.bizProjectInSchoolList;
  } catch (error) {
    console.log(error);
  }
};
onMounted(() => {
  getSubjectDetail();
});
</script>

<style scoped lang="scss"></style>
